import Vue from 'vue'
import VueRouter from 'vue-router'
import Signin from '../views/Signin.vue'
import Home from '../views/Home.vue'
import List from '../views/users/List.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Home,
    redirect: '/users',
    children: [
      {
        path: 'users',
        component: List
      },
      {
        path: 'intheaters',
        component: () => import('../views/movies/Intheaters.vue')
      },
      {
        path: 'comingsoon',
        component: () => import('../views/movies/Comingsoon.vue')
      }
    ]
  },

  {
    path: '/signin',
    component: Signin
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
